<?php 

class Qna extends Controller{
  
  function Qna(){
    parent::Controller();
	// let's check if the language is supported 
    $this->load->library('parser');
	if(!$this->session->userdata('language')  )
		{
			$this->config->set_item('language', 'english');
			$this->session->set_userdata('language', 'english');
		}
    $this->load->scaffolding('qna_'.$this->session->userdata('language')   ); 
    //$this->load->helper(array('form', 'url', 'text' ,'file'));
   
       
  }
  
  function index(){
    $query = $this->db->get('qna_'.$this->session->userdata('language'));    
    $data_temp = array( 
              'qna' => $query->result_array()
     );
    $data["html"] = $this->parser->parse('qna_template', $data_temp, TRUE);  
    $this->load->view('qna' , $data);
      
    echo $this->config->item('language');
  }
   
  
}

?>